package com.beans.userservice;

import com.model.User;
import org.springframework.stereotype.Service;

@Service //将当前bean对象存储到spring中
public class UserService {
    public void sayHi(String name){
        System.out.println("Hi "+name);
    }

    /**
     * 根据id获取用户
     * @param id
     * @return
     */
    public User getUserById(int id){
        //伪代码
        User user=new User();
        user.setId(id);
        user.setName("雪雪");
        user.setPassword("1234");
        return user;
    }
}
